#!/bin/bash
# back to cmdline, run this script with some argument like 
# ./print_cmd_vars.sh var1 var2 var3
# use $ with an argument index to use arguments passed by cmdline in script 

echo Argument: $1;
echo Argument: $2;
echo Argument: $3;

# get the number of arguments using '$#':
echo "you passed $# arguments through command line."

# get all arguments using '$@':
echo "what you passed: $@"

# use $0 to get this script name:
# the relative path of the script to your position is included in $0
echo "the script name: $0"

# use $$ to pring current PID 
echo $$;

# use $? to pring exit code of preceeding command
echo "the exit code: $?";
